home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qobjectdefs.h.z / qobjectdefs.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.5 KB  |  91 lines

  1. /****************************************************************************
  2. ** $Id: qobjectdefs.h,v 2.5 1998/07/03 00:09:35 hanord Exp $
  3. **
  4. ** Macros and definitions related to QObject
  5. **
  6. ** Created : 930419
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QOBJECTDEFS_H
  25. #define QOBJECTDEFS_H
  26.  
  27. #ifndef QT_H
  28. #include "qglobal.h"
  29. #endif // QT_H
  30.  
  31.  
  32. // The following macros are our "extensions" to C++
  33. // They are used, strictly speaking, only by the moc.
  34.  
  35. #define slots                    // slots:   in class
  36. #define signals protected            // signals: in class
  37. #define emit                    // emit signal
  38.  
  39. /* tmake ignore Q_OBJECT */
  40. #define Q_OBJECT                                  \
  41. public:                                          \
  42.     QMetaObject *metaObject() const { return metaObj; }                  \
  43.     const char  *className()  const;                          \
  44. protected:                                      \
  45.     void     initMetaObject();                          \
  46. private:                                      \
  47.     static QMetaObject *metaObj;
  48.  
  49. /* tmake ignore Q_OBJECT */
  50. #define Q_OBJECT_FAKE Q_OBJECT
  51.                         // macro for naming members
  52. #if defined(_OLD_CPP_)
  53. #define METHOD(a)    "0""a"
  54. #define SLOT(a)        "1""a"
  55. #define SIGNAL(a)    "2""a"
  56. #else
  57. #define METHOD(a)    "0"#a
  58. #define SLOT(a)        "1"#a
  59. #define SIGNAL(a)    "2"#a
  60. #endif
  61.  
  62. #define METHOD_CODE    0            // member type codes
  63. #define SLOT_CODE    1
  64. #define SIGNAL_CODE    2
  65.  
  66.  
  67. // Forward declarations so you don't have to include files you don't need
  68.  
  69. class QObject;
  70. class QMetaObject;
  71. class QSignal;
  72. class QConnection;
  73. class QEvent;
  74.  
  75. class QListM_QConnection;            // connection list
  76. #define QConnectionList      QListM_QConnection
  77. #define QConnectionListIt QListIteratorM_QConnection
  78.  
  79. class QDictM_QListM_QConnection;        // signal dictionary
  80. #define QSignalDict   QDictM_QListM_QConnection
  81. #define QSignalDictIt QDictIteratorM_QListM_QConnection
  82.  
  83. class QListM_QObject;                // object list
  84. #define QObjectList QListM_QObject
  85.  
  86. class QDictM_QMetaData;                // meta object dictionaries
  87. #define QMemberDict QDictM_QMetaData
  88.  
  89.  
  90. #endif // QOBJECTDEFS_H
  91.